#!/bin/bash
#program
#	读入文件student.txt中的数据，使用name+id为账户名称,然后删除这些账号
#history
#	2018-05-22:mjlf		第一次写入
student_file_path="./student.txt"
i=0
while read line
do
    student_id=`echo ${line} | awk -F " " '{print $1}'`
    student_name=`echo ${line} | awk -F " " '{print $2}'`
    if [ ${i} > 0 ]
    then
	student_account="${student_name}_${student_id}"
	userdel -r ${student_account}    
	echo "delete user : ${student_account}"
    fi
    ((i++))
done < ${student_file_path}
